﻿@model HouseAgencySite.Models.HouseInfos

@{
    ViewBag.Title = "房源明细";
    Layout = "~/Views/Shared/_DetailLayout.cshtml";
    List<SelectListItem> list = HouseAgencySite.Utils.ParamHelper.GetHouseArea(Request["AreaID"], true);
    List<SelectListItem> listHuXing = HouseAgencySite.Utils.ParamHelper.HuXing(true, Request["HuXing"]);
}
<article>
    <div class="row">
        <div class="col-md-10 table-bordered">
            <div class="row">
                <div class="col-md-6">
                    <div id="imgpreview" style="height: 400px;"></div>
                </div>
                <div class="col-md-6">
                    <ul class="list-unstyled">
                        <li><strong>@Model.Title</strong></li>
                        <li><strong>地址：</strong>@Model.AddressDetail</li>
                        <li><strong>面积：</strong>@Model.MianJi</li>
                           <li><strong>单价：</strong>@Model.Price 元</li>
                        <li><strong>户型：</strong>@listHuXing.FirstOrDefault(o => o.Value == Model.HuXing.ToString()).Text</li>
                        <li><strong>概要：</strong> @Html.Raw(Model.ZhaiYao)</li>
                    </ul>
                </div>
            </div>
            <input type="hidden" id="EstateNameTitle" value="@Model.EstateName" />
            <input type="hidden" id="hidLL" value="@(Model.MapUrl)" />
            <div class="row ">
                <div class="col-md-12 table-bordered" style="border-bottom: 0px;">
                    <div class="panel panel-default" style="width: 100%;">
                        <div class="panel-heading">
                            <h3 class="panel-title"><strong>房源信息</strong></h3>
                        </div>
                        <div class="panel-body">
                            @Html.Raw(Model.Description)
                        </div>
                    </div>
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h3 class="panel-title"><strong>周边</strong></h3>
                        </div>
                        <div class="panel-body">
                            @Html.Raw(Model.Around)
                        </div>
                        <table class="table">
                        </table>
                    </div>
                    <div class="panel panel-default">
                        <div class="panel-heading">
                            <h3 class="panel-title"><strong>交通信息</strong></h3>
                        </div>
                        <div class="panel-body">
                            @Html.Raw(Model.JiaoTong)
                        </div>

                    </div>
                     <div class="panel panel-default">
                        <div class="panel-heading">
                            <h3 class="panel-title"><strong>地图</strong></h3>
                        </div>
                        <div class="panel-body">
                               <div class="row ">
                    <div class="col-md-12">
                        <span class="r btn-full-screen cp"  style="display:none;"><i class="icon-full-screen"></i><span>全屏</span></span>
                        <span class="btn-exit-full-screen"  style="display:none;"><i class="icon-exit-full-screen" ></i>退出全屏</span>
                        <label>
                            <input type="radio" id="rdo2D" onclick="GetBaiduMap.changeUrl('/Home/baidu-map-partial?filter=1&estatename=' + escape($('#EstateNameTitle').val()) + '&ll=' + $('#hidLL').val());;" id="" name="map-types" />2D</label>
                        <label>
                            <input type="radio" onclick="GetBaiduMap.changeUrl('/Home/baidu-map-partial?filter=3&estatename=' + escape($('#EstateNameTitle').val()) + '&ll=' + $('#hidLL').val());" id="" name="map-types" />卫星</label>
                        <label>
                            <input type="radio" onclick="GetBaiduMap.changeUrl('/Home/baidu-map-partial?filter=4&estatename=' + escape($('#EstateNameTitle').val()) + '&ll=' + $('#hidLL').val());" id="" name="map-types" />街景</label>

                        <iframe id="ifrMap" class="ifr-map ifr-map-w734" frameborder="0" height="400" width="100%"></iframe>
                        
                       
                    </div>
                    <div class="text-center"><a class="btn btn-primary btn-sm" href="@Url.Action("HouseInfo", new { id = Model.HouseType, pageIndex = 1 })" >返回</a></div>
                </div>
                        </div>

                    </div>

                </div>
             
            </div>

        </div>
    <div class="col-md-2 table-bordered user-bj" style="height: 100%; min-height: 800px">
        <div id="photo" class="text-center"></div>
        <div class="list-group">
            <a href="#" class="list-group-item active">
                <h4 class="list-group-item-heading">经纪人
                </h4>

            </a>
            <a href="#" class="list-group-item text-center">
                <strong style="color: red; font-size: larger;">@(ViewBag.UserName)</strong>
            </a>
            <a href="#" class="list-group-item text-center">
                <strong style="color: red; font-size: larger;">@(ViewBag.UserTel)</strong>
            </a>
        </div>
    </div>



    </div>
</article>

<script type="text/javascript">
    Galleria.loadTheme('/scripts/galleria.classic.min.js');
    //加载图片
    var LoadImgs = function (ResourceID, imgcontainerID, imgclass, user, width, height) {
        if (typeof (imgclass) == "undefined" || imgclass.length == 0) imgclass = "img-rounded";
        if (typeof (width) == undefined || width.length == 0) width = 60;
        if (typeof (height) == undefined || height.length == 0) height = 80;
        $.get('/Admin/File/GetFiles/?ResourceID=' + ResourceID, function (d) {
            if (typeof (d) != "undefined" && d.length > 0) {
                $("#" + imgcontainerID).html("");
                for (var i = 0; i < d.length; i++) {
                    $("#" + imgcontainerID).append("<a href='/images/" + d[i] + "'    target='_blank'><img src='/Images/_thumbs/" + d[i] + "' width='" + width + "' height='" + height + "'  class='" + imgclass + "'/></a>");
                }
                if (!user) {
                    $("#imgpreview").galleria({ linkSourceImages: false, lightbox: true, transition: "fade", transitionSpeed: 1000, width: "500px", height: "400px", thumbHeight: "100px" });
                }
            }
        });
    }
    $(function () {
        LoadImgs('@(Model.Guid)', 'imgpreview', "img-rounded", false, "", "");
        LoadImgs('@(Model.CreateUserID)', 'photo', "img-rounded ", true, 160, 250);
        $('#rdo2D').attr('checked', true).click();
        $(".btn-full-screen,.exit-full-screen").unbind();
        //全屏显示地图
        $(".btn-full-screen").bind("click", function () {
            $("#ifrMap").addClass("iframe-full-screen");
            $("html").css("overflow", "hidden");
            $(".btn-exit-full-screen").show();
        })
        //退出全屏显示
        $(".btn-exit-full-screen").bind("click", function () {
            $("#ifrMap").removeClass("iframe-full-screen");
            $("html").css("overflow", "auto");
            $(this).hide();
        });
    });
</script>
